package com.example.wechat;

import androidx.room.Entity;
import androidx.room.PrimaryKey;

@Entity(tableName = "contacts")
public class Contact {
    @PrimaryKey
    private String id;
    private String name;
    private String avatarUrl;
    private String remark;
    private String pinyin;
    private String firstLetter;
    private String group;
    private String phone;
    private String email;
    private long lastUpdateTime;

    public Contact(int id, String name, String avatarUrl, String remark) {
        this.id = String.valueOf(id);
        this.name = name;
        this.avatarUrl = avatarUrl;
        this.remark = remark;
        this.lastUpdateTime = System.currentTimeMillis();
        // 这里应该使用汉字转拼音的工具类来设置pinyin和firstLetter
        this.pinyin = name;
        this.firstLetter = name.substring(0, 1).toUpperCase();
    }

    // Getters and Setters
    public String getId() { return id; }
    public void setId(String id) { this.id = id; }
    
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    
    public String getAvatarUrl() { return avatarUrl; }
    public void setAvatarUrl(String avatarUrl) { this.avatarUrl = avatarUrl; }
    
    public String getRemark() { return remark; }
    public void setRemark(String remark) { this.remark = remark; }
    
    public String getPinyin() { return pinyin; }
    public void setPinyin(String pinyin) { this.pinyin = pinyin; }
    
    public String getFirstLetter() { return firstLetter; }
    public void setFirstLetter(String firstLetter) { this.firstLetter = firstLetter; }
    
    public String getGroup() { return group; }
    public void setGroup(String group) { this.group = group; }
    
    public String getPhone() { return phone; }
    public void setPhone(String phone) { this.phone = phone; }
    
    public String getEmail() { return email; }
    public void setEmail(String email) { this.email = email; }
    
    public long getLastUpdateTime() { return lastUpdateTime; }
    public void setLastUpdateTime(long lastUpdateTime) { this.lastUpdateTime = lastUpdateTime; }
} 